require 'singleton'
require 'DbAccess.rb'

class Datos
  include Singleton

  def dvds
    if @dvds.nil?
	  @dvds = DbAccess.instance.dvds
	end
	return @dvds
  end

  def addPelicula (peli, dvd)
    if @peliculas.nil?
	  @peliculas = []
	end
	if @dvds.nil?
	  @dvds = []
	end
	@dvds << dvd
	@peliculas << peli

	DbAccess.instance.addPelicula peli
	DbAccess.instance.addPelicula_x_Dvd peli, dvd
  end
  
  def peliculasXdvd pelicula=nil, fechaMin=nil, fechaMax=nil, dvd=nil
    return DbAccess.instance.peliculasXdvd pelicula, fechaMin, fechaMax, dvd
  end
  
  def addPeliculas peliculasXdvd
    DbAccess.instance.addPeliculas peliculasXdvd
  end
  
  def updPelicula pelicula, dvd=nil
    DbAccess.instance.updPelicula pelicula, dvd
  end

  def generos
    return DbAccess.instance.generos
  end

end
